package aufgabe3;

/**
 * @author Johannes Riedmann
 * @author David Medenjak
 * @author Lukas Koell
 */
public class Triangle implements Polygon{

    /**
     * Member variables
     */
    private float a, b, c;
    
    /**
     * Constructor
     * @param a > 0.00
     * @param b > 0.00
     * @param c > 0.00
     */
    public Triangle(float a, float b, float c){
        this.a = a;
        this.b = b;
        this.c = c;
    }
    
    /**
     * @return number of edges of triangle == 3
     */
    public int edges(){
        return 3;
    }
    
    /**
     * @return area of the triangle > 0.00
     */
    public double area(){
        double s = perimeter() / 2;
        return Math.sqrt(s*(s-a)*(s-b)*(s-c));
    }
    
    /**
     * @return perimeter of the triangle > 0.00
     */
    public double perimeter(){
        return a + b + c;
    }
    
    /**
     * sets value for a
     * @param a > 0.00
     */
    public void setA(float a) {
        this.a = a;
    }
    
    /**
     * sets value for b
     * @param b > 0.00
     */
    public void setB(float b) {
        this.b = b;
    }
    
    /**
     * sets value for c
     * @param c > 0.00
     */
    public void setC(float c) {
        this.c = c;
    }
}
